<%-- 
    Document   : evento
    Created on : 16-feb-2012, 9.35.14
    Author     : Ivan
--%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.List"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <script src="JS/style.js" type="text/javascript"></script>
        <link rel="stylesheet" type="text/css" href="style.css">
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Pagina Evento</title>
    </head>
    <body>
        <%@include file="header.jsp" %>
        <div id="content">
            <%
                String[] ris = (String[]) session.getAttribute("risultato");
            %>
            <div id="imgLocale">
                <fieldset>
                <img id="immagine" src="<%= ris[2]%>" class="img"/>
                </fieldset>
            </div>
            <div id="description">
                <fieldset class="title">
                    <p id="pubName"><%= ris[0]%></p>
                    <p id="pubProp">organizzata da <%= ris[5]%></p>
                </fieldset>
                <div id="info">
                <fieldset>
                    <%@ page import="org.netbeans.saas.*, org.netbeans.saas.google.*" %>
                    <%
                        try {
                            java.lang.Integer zoom = 15;
                            String iframe = "false";
                            RestResponse result = GoogleMapService.getGoogleMap(ris[7], zoom, iframe);
                            out.println(result.getDataAsString());
                        } catch (Exception ex) {
                            ex.printStackTrace();
                        }
                    %>
                        <legend>Informazioni Utili</legend>
                        <button type="button" name="home" value="home" class="css3button4">Indirizzo:</button> <%=ris[7]%><br />
                        <button type="button" name="home" value="home" class="css3button4">E-mail:</button> <%=ris[6]%><br />
                        <button type="button" name="home" value="home" class="css3button4">Telefono:</button> <%= ris[8]%><br />
                        <button type="button" name="home" value="home" class="css3button4">Numero Posti:</button> <%=ris[4]%><br />
                        <button type="button" name="home" value="home" class="css3button4">Orario:</button> <%=ris[9]%><br />
                        <button type="button" name="home" value="home" class="css3button4">Data evento:</button> <%=ris[3]%></p>
                <%
                        if (session.getAttribute("login") != null && session.getAttribute("group").equals("locale") && session.getAttribute("login").equals(ris[5])) {
                    %>
                    <p>
                        <a href="/EsameSSCSWeb-war/Servlet?action=cancellaEvento"><button type="button" name="login" value="newEvent" class="css3button6">Cancella evento</button></a>
                    </p>
                    <%                        }
                    %>
                    </fieldset>
                </div>
                
                <div id="descLocale">
                    <fieldset>
                        <legend>Descrizione Locale</legend>

                        <p><%=ris[1]%></p>
                    </fieldset>
                    <%
                        if (session.getAttribute("login") != null && session.getAttribute("group").equals("cliente")) {
                            %>
                    <form action="/EsameSSCSWeb-war/Servlet?action=prenota&nome=<%= ris[0]%>&tipo=evento" method="post">
                        <fieldset>
                            <legend>
                                Prenotazione
                            </legend>
                            <table border="0">
                                <tr>
                                    <td>
                                        Numero di posti:
                                    </td>
                                    <td>
                                        <input type="text" name="numposti"/>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Data:
                                    </td>
                                    <td>
                                        <input type="text" name="data" value="<%=ris[3]%>" readonly="readonly" />
                                    </td>
                                </tr>
                            </table>
                            <p>
                                <button id="submit" type="submit">Prenota <img src="img/ok.gif" alt="ok"/></button>
                                <button type="reset">Cancella <img src="img/cancel.gif" alt="cancel"/></button>
                            </p>
                        </fieldset>
                    </form>
                    <%}%>
                </div>
            </div>
        </div>
    </body>
    <script type="text/javascript">
        window.onload = function()
        {
            sottobarra=document.getElementById("subbar1");  
            cerca=document.getElementById("cerca");
            sottobarra2=document.getElementById("subbar2");  
            sottobarra3=document.getElementById("subbar3");  
            login=document.getElementById("login");
            cerca.style.display="none";
            sottobarra.style.display="none";
            login.style.display="none";
            if(sottobarra2!=null)
                sottobarra2.style.display="none";
            else
                sottobarra3.style.display="none";
            loadScript();
        }
        windows.onunload=GUnload();
    </script>
</html>
